<?php
Route::group(['prefix' => 'cashier', 'namespace' => 'Cashier', 'as' => 'cashier.'], function () {
//    Route::get('/', 'HomeController@index')->name('index');

    //商品管理
    Route::group(['prefix' => 'product'], function () {
        Route::patch('sort_order', 'ProductController@sort_order')->name('product.sort_order'); //ajax排序
        Route::patch('stock', 'ProductController@stock')->name('product.stock'); //修改库存
        Route::delete('delete_more', 'ProductController@delete_more')->name('product.delete_more'); //删除多条
        Route::get('export', 'ProductController@export')->name('product.export'); //导出盘点表
    });
    Route::resource('product', 'ProductController', ['except' =>
        ['create', 'store', 'show']]);  //创建商品路由除去新增和保存

    //品牌管理
    Route::group(['prefix' => 'brand'], function () {
        Route::patch('sort_order', 'BrandController@sort_order')->name('brand.sort_order'); //ajax排序
        Route::patch('change_attr', 'BrandController@change_attr')->name('brand.change_attr'); //改变属性
        Route::delete('delete_more', 'BrandController@delete_more')->name('brand.delete_more'); //删除多条
    });
    Route::resource('brand', 'BrandController');


    //商品分类
    Route::group(['prefix' => 'category'], function () {
        Route::patch('sort_order', 'CategoryController@sort_order')->name('category.sort_order'); //ajax排序
        Route::patch('change_attr', 'CategoryController@change_attr')->name('category.change_attr'); //改变属性
    });

    Route::resource('category', 'CategoryController');


    //供应商管理
    Route::group(['prefix' => 'apply'], function () {
        Route::patch('sort_order', 'ApplyController@sort_order')->name('apply.sort_order'); //ajax排序
        Route::delete('destroy_more', 'ApplyController@destroy_more')->name('apply.destroy_more'); //删除多条
    });
    Route::resource('apply', 'ApplyController');

    //店铺管理
    Route::group(['prefix' => 'store'], function () {
        Route::delete('destroy_more', 'StoreController@destroy_more')->name('store.destroy_more'); //删除多条
    });
    Route::resource('store', 'StoreController');


    //员工管理
    Route::group(['prefix' => 'employee'], function () {
        Route::delete('destroy_more', 'EmployeeController@destroy_more')->name('employee.destroy_more'); //删除多条
    });
    Route::resource('employee', 'EmployeeController');


    //会员管理
    Route::group(['prefix' => 'member'], function () {
        Route::delete('destroy_more', 'MemberController@destroy_more')->name('member.destroy_more'); //删除多条
    });
    Route::resource('member', 'MemberController');


    //采购进货
    Route::group(['prefix' => 'purchase'], function () {
        Route::patch('sort_order', 'PurchaseController@sort_order')->name('purchase.sort_order'); //ajax排序
        Route::patch('stock', 'PurchaseController@stock')->name('purchase.stock'); //修改库存
        Route::delete('delete_more', 'PurchaseController@delete_more')->name('purchase.delete_more'); //删除多条
    });
    Route::resource('purchase', 'PurchaseController');


    //库存调拨
    Route::group(['prefix' => 'allocation'], function () {
        Route::delete('destroy_more', 'AllocationController@destroy_more')->name('allocation.destroy_more'); //删除多条
    });
    Route::resource('allocation', 'AllocationController');


    //销售管理
    Route::group(['prefix' => 'sale'], function () {
        //会员消费记录
        Route::get('member_sale', 'SaleController@member_sale')->name('sale.member_sale');
        //门店当日销售额
        Route::get('store_sale', 'SaleController@store_sale')->name('sale.store_sale');
        //门店当月销售额
        Route::get('month_sale', 'SaleController@month_sale')->name('sale.month_sale');

    });
    Route::resource('sale', 'SaleController', ['only' => 'index']);



});
